/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { exportExcel } from '@/services/operatorManagement';

export const download: (query: Record<string, any>) => Promise<string> = (query) => {
  return new Promise((resolve, reject) => {
    exportExcel({ export: query.time })
      .then((res) => {
        const { code, data, msg } = res;
        if (code == 0 && data) {
          resolve(data);
        } else {
          reject(msg);
        }
      })
      .catch(() => {
        reject();
      });
  });
};
